<?php
// +----------------------------------------------------------------------
// | yylAdmin 前后分离，简单轻量，免费开源，开箱即用，极简后台管理系统
// +----------------------------------------------------------------------
// | Copyright https://gitee.com/skyselang All rights reserved
// +----------------------------------------------------------------------
// | Gitee: https://gitee.com/skyselang/yylAdmin
// +----------------------------------------------------------------------

// 首页控制器
namespace app\index\controller;

use app\index\service\IndexService;
use hg\apidoc\annotation as Apidoc;


class Index
{
    /**
     * 鹿萌萌管理首页
     * @return \json
     */
    public function index()
    {
        $data = IndexService::index();
        $msg  = 'saas首页管理测试拉取更新';

        return success($data, $msg);
    }

    /**
     * @api {get}  index/Index/bb 测试
     * @apiVersion 0.1.0
     * @apiName bb
     * @apiGroup 测试管理
     *
     * @apiParam {string} username 用户名称.
     * @apiParam {string} password 密码.
     *
     * @apiSuccess {String} admin_admin_id 用户id.
     * @apiSuccess {String} admin_token  用户token.
     * @apiSampleRequest index/Index/bb
     * @apiSuccessExample Success-Response:
     *     HTTP/1.1 200 OK
     *     {
     *           code: 200,
     *           msg: "登录成功",
     *           data: {
     *           admin_admin_id: 2,
     *           admin_token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsampBZG1pbiIsImlhdCI6MTYyOTE2Nzg2OCwibmJmIjoxNjI5MTY3ODY4LCJleHAiOjE2MjkyMTEwNjgsImRhdGEiOnsiYWRtaW5fYWRtaW5faWQiOjIsImxvZ2luX3RpbWUiOiIyMDIxLTA4LTE3IDEwOjM3OjQ4IiwibG9naW5faXAiOiIxMjcuMC4wLjEifX0.QhnW5Y-3QiQ1tJBkpIHkhIcBr6JplHaI_byvZxN9k8E"
     *               }
     *           }
     *
     * @apiError UserNotFound The id of the User was not found.
     *
     * @apiErrorExample Error-Response:
     *     HTTP/1.1 404 Not Found
     *     {
     *       "error": "UserNotFound"
     *     }
     */
    public function bb()
    {
        return success([
            "id" => 1,
            "name" => "zhangsan",
        ]);

    }
}
